<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style>
table { background-color: black; }
td, th { background-color: lightgray; }
</style>
</head>


<?php

  include_once $_SERVER['DOCUMENT_ROOT'] . '/db.php';
	
	if (!IsDBConnected())
	{
		echo 'ERROR: No connection with database';
		return;
	}
	
	$res = mysql_query('select * from `requests`');
	echo 'Total number of requests: ' . mysql_num_rows($res);
	echo '<table border=0 cellpadding="3" cellspacing="1" width=100%>';
	echo 
		'<tr>',
			'<th>ID</th>',
			'<th>FIO</th>',
			'<th>Phone</th>',
			'<th>Request</th>',
			'<th>Time</th>',
			'<th>Status</th>',			
		'</tr>';
	while($data = mysql_fetch_assoc($res))
	{
		echo 
			"<tr>",
				"<td>{$data['ID']}</td>",
				"<td>{$data['FIO']}</td>",
				"<td>{$data['Phone']}</td>",
				"<td>{$data['Request']}</td>",
				"<td>{$data['SubmitTime']}</td>",
				"<td>{$data['Status']}</td>",
			"</tr>";
	}
	echo '</table>';
	

?>